<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>index.js</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../css/github.css" type="text/css" media="screen" />
<script src="../../../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
    <div class="banner">
        
        <h1>
            index.js
        </h1>
        <ul class="files">
            
            <li>
                lib/assets/javascripts/ems_app/store_staffs/index.js
                
            </li>
            <li>Last modified: 2017-01-06 17:07:47 +0800</li>
        </ul>
    </div>

    <div id="bodyContent">
        <div id="content">
  
    <div class="description">
      
<p>jQuery(function($){</p>

<pre><code>$(document).on(&quot;click&quot;, &quot;a.js-staff-to-reset-pwd&quot;, function(){
  var id = $(this).data(&quot;id&quot;);
  var storeId = $(this).data(&#39;store-id&#39;);
  console.log(storeId);
  var input = &quot;登录名: &lt;input type=&#39;text&#39; name=&#39;login_name&#39; class=&#39;ttd js-reset-authenticate-dialog-login-name&#39; required=&#39;true&#39; /&gt;&lt;br&gt;&quot;+
              &quot;　密码: &lt;input type=&#39;password&#39; name=&#39;password&#39; class=&#39;ttd js-reset-authenticate-dialog-password&#39; required=&#39;true&#39;/&gt;&quot;
  commonEvents.popupView(&quot;公司超级管理员验证：&quot;, input, &quot;确 定&quot;)
  $(&quot;button#modal_okBtn&quot;).on(&quot;click&quot;, function(){
    var loginName = $(&quot;input.js-reset-authenticate-dialog-login-name&quot;).val();
    var pwd = $(&quot;input.js-reset-authenticate-dialog-password&quot;).val();
    console.log(loginName);
    if (loginName == null || loginName == &quot;&quot;){
      showErrorView(&quot;请填写用户名&quot;);
      return false
    }else if (pwd == null || pwd == &quot;&quot;){
      showErrorView(&quot;请填写密码&quot;);
      return false
    }else {
      $.ajax({
        url: &quot;/api/store_staffs/authenticate&quot;,
        type: &#39;get&#39;,
        data: {store_id: storeId, login_name: loginName, password: pwd},
        success: function(data){
          if (data.status == true){
            location.href = &quot;/ems/store_staffs/&quot;+ id +&quot;/pwd?store_id=&quot;+ data.store_id
          }else {
            showErrorView(data.msg);
            return false
          }
        },
        error: function(data){

        }
      })
    }

  })
}) // end to reset pwd</code></pre>

<p>})</p>

    </div>
  


  


  
  


  


  

  



  

    

    

    


    


    <!-- Methods -->
              </div>

    </div>
  </body>
</html>
